package com.coocaa.ops.admin.v1.audit.provider.impl;


import com.coocaa.ops.admin.v1.audit.model.CheckInfoModel;
import com.coocaa.ops.admin.v1.audit.model.ExecutionTaskModel;
import com.coocaa.ops.admin.v1.audit.provider.IAuditTaskProvider;
import com.coocaa.ops.admin.v1.cornericon.biz.impl.CornerIconBizImpl;
import com.coocaa.ops.common.core.base.model.ResourceBaseModel;
import com.coocaa.ops.common.core.biz.cornericon.entity.GlobalCornerIconEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author bijiahao
 * @date : 2018/11/13.
 * @description: 审核前校验-审核-撤销审核-上架操作 提供者接口实现-角标
 *
 */
@Service
public class CornerIconAuditTaskProviderImpl implements IAuditTaskProvider {
    @Autowired
    private CornerIconBizImpl cornerIconBiz;

    @Override
    public void auditTask(ExecutionTaskModel executionTaskModel, Integer userId) {
        GlobalCornerIconEntity iconEntity = new GlobalCornerIconEntity();
        iconEntity.setId(executionTaskModel.getId());
        iconEntity.setModifier(userId);
        iconEntity.setStatus( executionTaskModel.getAuditFlag());
        cornerIconBiz.updateById(iconEntity);
    }

    @Override
    public void putShelves(ResourceBaseModel resourceBaseModel, Integer userId) {

    }

    @Override
    public void revokedAudit(ResourceBaseModel resourceBaseModel, Integer userId) {

    }

    @Override
    public CheckInfoModel checkBeforeAudit(ResourceBaseModel resourceBaseModel) {
        return CheckInfoModel.getCheckInfoModel(Boolean.FALSE, null);
    }

    @Override
    public void cancelTask(ResourceBaseModel resourceBaseModel, Integer userId) {

    }
}
